updates for issue #577 and fix for #537