Fixed bug in ViewObject(), resources weren't being deleted, which meant the databse stayed locked.