Fixed bugs in flood fill. Added more unit tests.