Fixes access to invalid index on Windows