Laser frequency stabilization for atom cooling and magnetic-field compression of the trap