Add some error checking to checkmodule.py script.