Making fix of commit 299201fdef compatible with Mac OSX.