some fixes for issue #29