added nullpointer check and corrected typo;
adapted non subject organ processing to accomodate for cases in which
lastElements is ruled out