fix a bug with file description comment being ignored
some cleanup in write.php