Finally found the bug!