Fixes bugs detected so far in the bootstrap process from a clean database