Fixed error in resolving day of week