Fixed validation bugs

Code was not working and crashed the server (added extra checks for the researchDomains)...