move checkArgs to non-static so usable in modules
fix error message formatting for key()