various fixes, segfault example added