Multifunction valves