Fix command handling