Misc Fixes.
Removes a segfault from the previous version (caused by an incomplete feature)