issues #142 and #143 fixed