Fixed an error with the new command loop mechanism