Fix to invalid command handling