Minor refactoring of patch command and commenting.