Updated tests

Functional test doesn't work though because sqlite doesn't support the
UUID() operation.