Fixed reading of base element property
Added ASSERT check for recursion error and minor code cleanup