Fields fix

Taking the fix from @jschmid and fixing it, as it had some syntax errors.  Also fixing up some unit test issues I unearthed while going through the test suite.