fix for os_version. and add several test cases.
Fixed code style to follow PEP8