Fix occasional black lines between tiles

Closes #1059