Fixed a few minor issues incl thresholds in compare function.
Everything seems to be working now.