Fix to generate_fill to force the width to be type float so that width / total does not round down, and ceil(width / total) gives the correct number of tiles.