Implemented element number checking.