fixed error message length and MAX_ELEMENTS