fixes LP #1212680. Patch provided by Midori Kato.