Fix database prefix usage

Of course this fix should also be merged in the upcoming 3.6 and develop.