some small fixes and simplifications