Various Fixes

I created only one pull request for my changes today, but all commits are independent.