backported fixes for OpenPetra.now that have already been applied upstream since the last freeze