Applying a fix for #12 and #14.