Fixed small issues throughout the codebase

- Simplified some clamps
- Fixed values not being handled in a `switch`
- Removed unused "debug" fields in `Trees.cpp`