Count frame stats before processing the frame.
This avoids any exceptions upsetting the frame statistics.
Updated debugging and clear initialisation queue on wakeup
Fix initialisation of wakeup class