Fixes for 5.0 and 4.8