mend

NoSuchElement exception handling added. Some bugs fixed