bug fixes and cleanup. Don't allow empty commands

code such as "does-not-exist(foo,1)" will throw a valueerror