Added code for OSX in comments / substring(1) is not portable