Added check to BST height limiter to prevent infinite loop