Apply various minor fixes