fixed bug in last refactoring of the julian date calculation.