Added input validation on the client-side, fixed some code style problems.