Fixed some bugs with end_of_week method