Fix for issue described in #1257