minor improvements, one bugfix