finished fixing portability issues.