Implements #967