Fixed seg-fault