Implements #1139