Bug fixies, improve portability.
Bug fixies, and cleaned up all portability issues.