This could use a more user-friendly error message with info about the element.