add minor improvements and fixes