Remembering the selected card indices

I think I may have finally solved Issue #125 . Please test this thoroughly as this was a very tricky bug fix and I'm not 100% confident in it myself, but it seems to work.