further portability improvements