Bugfixes 20140526

Bugfixes to be merged into master before 3.1