Cleanup comparisons and one bugfix