Improved getangle script behaviour