Magnetic ordering and spin fluctuations in nearly half-doped manganites