Improved precision when scaling images (fixes a regression).
Fixes for building on Windows.