Bug fixes

ditto