Some fixes in canopy database, thanks to Johan.