Fixed some context bugs and added a log for the received command.