Fix exceptions, and start testing them