Fixed settings
Also added saving the geometry at shutdown