a few bug fixes

A few bug fixes after fridays big merge.