Increase portability

* Fix mktemp: too few X's in template on Linux
* Fix operator error near ~= on Windows