multiple small improvements and fixes