Added argument count checking.
Improved error reporting.