Fixed date bugs and many other small errors