Improved block fill algorithm.