fixes for issue #23 and #26