Implemented icall: `output.clear` and some fixes