improved control of asserts
Removed dead code
Add support for nullary functions