Additional fixes for #4993