further fixes/cleanups to OS detection