Fixed a bug where the candidates list was passed around by value. Small readability related changes.