Fix for null database ID inserts and null dates