Moved add_action calls directly before the hooking functions.