Fix off by 1 error in missingchunks
fix off-by-one error in missing chunks
remove environment for database