The database stuff should work now, after changing some stupid code.
(with some more stupid code? )