Fixed sementation fault.