Fixed seg fault and a leak in CommUlongStringKernel and added a unit test