Fixed tests. Moved exception to correct place.