Fix local inconsitence across systems
Restoring system default loca by RAII
Remove unecesary call to setlocal that n some systems could generate a error
Merge pull request #89 from Zardoz89/fix_local

Fix local inconsitence across systems