Lawmakers agree to undo 'raid' on environmental trust fund