Bug fixes

Bugs fixed