Fixed according to David's suggestions, minor fomatting and some new tests for dates