Fix for #77 & #78