Fix getWhichEnd problem in windows

Fix [#385](https://github.com/bolt/bolt/issues/385)