Fixed issues with command pattern implementation