Lazy reference submit hook generalized, bugfixed.