Fixed segfault:|. And did some integration testing