More segfault fixes and correcting naming of a function and variable.