some minor changes, putfile bug fixed