More bug fixes plus lot's of new debugging print statements, most of which should be commented out