Fix for switching functionality.