Fixed issue #60
Some initial work on issue #48
More work on the database