Fix issues #75 and #58