fix ton of bugs for poc-7 compatibility