Updated portable support for more platforms.