Fixes #6268 #6122 #6121

Er, references: #6268 #6122 #6121