Added NULL checks for brake and throttle