Switching logic and crash checks revised