Fixes to database recipe and small improvements