Updated to attempt to make library cross platform.