fixes for issue #33 and #32