Fixes first part of #3488 & #3566