New tests for the prepare method, and some tweaks
to satisfy the tests