Implemented icall `output.clear` + some fixes

- Implemented icall: `output.clear`
- Some small fixes