Fix application crashes after #2772