red lint, many minor improvements and fixes