Minor portability improvements