Fix some compiler warnings.

New test to check if normalization is idempotent. (It sometimes is not!)