Major changes and fixes