Added check for filetype. Should fix loading issues on Windows.