Bug fixes

Fixing bugs before release