Finally found bug. It was caused by the wrong offset in the calling sub.