Added basic tests for Commands & some bugfixs