Fix handling of platform specific path separator (fixes #651).