Fixed many bugs with commands.