fix uninitialized value warnings
fix use of database parsed from URL