Solution to #829