Fixes for bugs #153 & #155