Fixed issues #47 and #48