Fixed some issues with how dates were being handled by sqlite