Fixes for #153, #141, and #129