refactoring: cache singletons
fix #3499: exception when parsing bad coordinates