Bugged. Bits of AP initialization, attempt at fixing recursive lock.