Applied patch from RT #52369
Fixed some compiler warnings