Backport fix for datetime auto_now issues from 1.5 branch
Backport ForeignKey insert fix from 1.5 branch