Fix compiler warnings related to #4563 and #4610