Moved some assertions to test code, for performance