Fix a bug in calculating the norm of results