Bugfixes

Fix #8218
Fix #8069