Fixes for #14, #15, and #16