Some updates and fixes from the dev branch