Fix for #32 and #33