Fix name property access of sort function