Code styling cleanup and fixed another date calculation bug