Fix #390 and modified_date bug

This should fix #390.
And I found that, modified_date has a default value of 0000-00-00 00:00:00 and not null, the original if clause didn't work as expected.
Now I've tested, it's fine :smile: