Fixed generating empty primary key when not in table. Issue #98