fix for 2.5 compatibility and other corrections