This is the fix. If you start on sunday... it'd better be 7 not 0... Those louzy formulas from wikipedia.