Fix tile size retrieval for Flex

...and add some tests too.

Fixes ticket #10259.