Hotfix 4.6.5

@andreasohlund @SimonCropp please review.

This PR fixes 2 of the issues assigned to 4.6.5