Added stricter type checking in some comments and code.