Complex bug found and fixed