fix issues #152 and #153