Fix database init query