Fixing bugs with various gadgets