Still windows compatibility issues. Cleaned up code.