Improved OS detector