some fixes for issue #228