Populate local db; fix errors where necessary