Apply code review comments from Jon, fixed up test with new code