Fixed db wrapper and reset script so multiple SQL calls can be called in succession