Added Document Table to Database and other minor fixes
Merge remote-tracking branch 'upstream/master'