Fixed a few more portability issues