More merging of develop into refactor-syntax_unicode
Fixed to compile on OSX