Various Improvements and bug fixes