Fix tiles incorrectly displayed sometimes. Fix #401.

The bug was an invalid access in a vector.