Better error checking and more informative messages for initial db build