Updated document flow and general fixes