Improved patch for var assignmments in commands