Improved Command constructor.

Now it checks if data format is corresponding to type of command.