Fixes parse error catching
Fixes database indices