Fix #5873 and cleanup kernel config