Bug fix from 1 9 merged into 2 0

This PR should not go in before #980

Contains the fix "Fixes problems with extra columns showing up in some conditions"