fixed assertraises errors in tests