Fix type checking in commandResult()