bug fixes for issue #14