Fix an off-by-one error causing date parsing to fail

Number parsing would fail if it was the last item in the input string.
Fix a reference leak in MCD_convert_from_datetime