Fixed tests and added useful failure messages