Added portability code.