Fixed formatting, db initialisation and search crashes.