I've just uploaded an updated version of the game which fixes the out of bounds issue and the shortchanging when you sell partial stacks.