Fix for #15 and #14