Further db statements fixes, some qml restructuring fixex