Fix for dates bug