Fixed a problem with the date token. Also fixed a logic issue and updated tests (still problems, but less of them).