Fixes #3073 avoiding php errors