Small improvement: load kernel resources only for debug mode
Fix small bug on Windows, when there are mixed directory separators in the path