Fixed bug in apply_primitive

added support for (exit).