[misc] fix an issue with Far Manager

* Closes #161
* Also fix a couple warnings from MinGW and VS