updates for issue #1002 and #998