Fixes for issues #27 & #29