See the individual comments on each commit. This is a house keeping patch, no visible effects for now.