miscellaneous fixes.

only view tests don't pass for now.

t/001-load.t ........ ok
t/002-server.t ...... ok
t/003-database.t .... ok
t/004-document.t .... ok
t/005-view.t ........
t/005-view.t ........ Failed 5/5 subtests
t/006-attachment.t .. ok