Fix geometry and state in first start
Leave constructor parameter for document class
Small fixes on document handling