Made sure flashes work and fix test-bugs