Minor tweaks to avoid unnecessary virtual calls.