Fix completely broken orientation detection
Update version number to 4.0.1