Small fixes in quaternion routines