Don't allow null magnitudes, also tidy code