Implements #1251