Fixed some issues in libfaction which caused crashes.