Fixed issues #72 and #52