Implemented logging and fixed commands