Implements #21.