Improved and simplified device inclination calculation. Fixes #1