Fix mode parsing in tree objects