Made the DB init script more resilient to a failure half way through