Overall improvements

Bug fixes