Fixed some arithmetic errors in arc calculations