Fix issue #77 & #76

This request fixes issue #77 & #76.