Added fallback for more entities supported by newer php versions.