Fix EncodeError call for builtin types.