Some db values set to NOT NULL
Correctly closing cursors