Fixed the insane null-pointer runtime exceptions. F****** finally.