general changes and fixes