some minor improvements and fixes