Fixed segment fault.