Bug fixes for 2.1

Most of the issues for 2.1 are fixed with this Pull Request.