Structure scanner fixes

When finished should this closes #1224