More bugfixes.
Bugfix -- charles can you 2x check this one?