Lots of enhancement and fixes