Fix listmissingpatches function