endleaf bug

major problem: did not account for integral endleaves and texthooks:
fixed