Fix sort syntax, fix missing comma, remove unused variables in map function.