Fixes for issues #198, #201, #202, and #203