Fixed bug occurring when function is not Morse.
Removed some debugging output.