Small bugfix.

- Fixes some problems with parameters becoming 'null' variables.
- Clear function improved.