Fixed bug where vector should have been passed by reference.