Fix indexing error in if-test.
Use correct number of items in initialiser.