The Quaternion class has been modified so that in a number of cases when it is initialised from data that would result in corruption, its valid flag is cleared. Many arithmetic operator functions have been reimplemented to make them more efficient and more compact.