Added dumping support
Fixed segfaults caused by e99aee5befa95fafcd616b9b358c06e0fcd6ab89