fix a warning
prevent warnings caused by ambiguous arguments
prevent warnings by shadowing var names
Merge pull request #898 from JonRowe/cleanup

Cleanup warnings