Bug fixes

Bug fixes for issues raised.