Replace lists with vectors when possible