Fixed bug in attitude.c