Fixed minor issues. Added support for copy/move-overwrite. Reformatted code