Various improvements and fixes
Various improvements and fixes