Fixed SegFault issue.
Current bugs: