fixed some issues with upcase, and sorting