Various source cleanup, fixed yaml save bug