Fix undefinied offset bug in tests