Fix issues for #51