Fixed a crash at certain angles