Fixes for issues #47 & #46