Fixed input validation in all these files.