some small fixes and checks