minor fixes and compability improvements