Fixed automatic command detection