fixed backwards compatibility issues on null/undefined end marker