Fixed my segfaults and payed for my sins