Improved backward compatibility.

Tested under Symfony:
- 2.1.13
- 2.2.11
- 2.3.12