various fixes

here are some fixes you should merge to your master branch.