Fixes for issues #23 and #24