Issue 5320 upgrade from 2.5.4 errors

fixes #5320 #5290