Cleanup and minor fixes to spam checking