decoder: fix wrongly decoded Date.
Add global debug flag.