Merged into master for version 3.1