Removed buggy date2doy function and replaced with better method.
Made error messages more useful.
Changed example used to fit new, shorter dataset.