minor improvements and fixes