Fixed solutions array to keep it small. Other small improvements.