Fixes more cyclic references in scan and application.