Fixed file ops, cleanup.