Implements #1005