Fix test errors

Fixes a few errors that were found in the test code.