A couple fixes

See commits to see which issues are fixed.