Minor fixes in apps
This addresses some unchecked allocation errors and other minor issues in tools.
- Code modified for feature
- There is a test suite reasonably covering new functionality or modifications
- Function naming, parameters, return values, types, etc., are consistent with other code
- This feature/change has adequate documentation added
- No obvious mistakes in the code