Solve issues #3423 and #5374

Done