Added crazy debugging (dumping to files).