improve tolerance (charset === null)
fix import issues