Commit Ian's fixes from Bug 3877
I have tested these on miniglx and they seem to be working.
I'm sure Dave will give them a better test.
6 files changed