Fixed a few OS level bugs..