HH-37492 stricter handler release check

HH-37492 better error logging
HH-37492 finally move tests to appropriate location
HH-37492 cleanup, correct code handling in tuple case