Fixed db errors, added truncateAll()