Updated null pattern.
Fixed template functions (missing arg).

Also: added docstrings.
Improved error message.
Updated function to create script.