Refined fix for issue #26