Added some portability code for the ctype functions.