Proposed compatibility Contao 3.4 (see #16)

Also re-added the 4ed3969 changes that somehow got lost.