Cleanup.
Also implemented embedded_file writing ( not used in this project ).