Fixed bug in close-document. Changed test so that default-app is used instead of a full init(ialized) app.