Implements #1249