Fix for #59 and #60