Update examples, minimize code size

- Updated some example files and tests
- Small changes to minimize code size