Fixes for compatibility with 2.4