[BUGFIX] Prevent inserting null into NOT NULL column