Fix caching

Fix error with caching where I was not checking for changes in the ...
argument list.

Minor code cleanup and refactoring