fixed sigsegvs from vector
better framework for tests