issue #23 bug fixes