fixed bug where the date detection fails when the 1st is a thursday. Also fixed a wrong test