Optimized tree, fixed jsHint warnings.