Fix logic bug introduced with command refactor