Added AFC and debug stuff.