Fix comparisons across the project

This improves performance because way less string objects are created, and also fix a few globalization warnings.