Merge branch 'devel'

bug fixes, mostly.
Merge branch 'devel'
Merge branch 'master' into devel