Fixed logical and syntax errors with finding EulerAngles