Implements #1165