Fix bug in max norm calculation that was returning negative values if all elements were negative.
Cleaned up code from minimum distance curve testing.