Fixed some errors in the implementation of the quaternions.