Added testing hooks.