Fixed issue #555: Thanks to @ofred