Bug fixes, anti-spam measures, moderate refactoring