Made some minor portability tweaks