minor fixes and checks