Updating tests and adding better eror messages