Minor fixups to prepare for windows port