Flatten updateTree() slightly, minor syntax/style changes

- Changes updateTree() to return earlier when error conditions are encountered
- Minor readability fixes (hash style, etc)
- Minor 1-line-if changes (it made diffing/merging easier, can take it out if its a problem)