Fix for #3254.
Fix for #3255.
Merge pull request #3259 from Segrain/master

Science bugfixes.