Two bug fixes

Fixes for #463 and #448