Fix 1198 and 729: Fixes links with custom locale and related OSX test errors

This PR includes and builds on the work done by @smartass101 (3f6b130) which resolves #1198.

I've added fixes for related test errors on OSX in order to resolve #729.