Some fixes for 5.0