Using fail instead of raise to signal exceptions.