Fixed tree.getCover() and added appropriate unit test