small fixes and larger, but faulty relation db