segfault hunting

See http://pastebin.com/GnwRJVhK and http://pastebin.com/dLQF97qS for stack traces.