Fix altitude support

Fix signs
Fix wrong variable
Fix r