Implements #923, fixes #924