Added a bunch of record nil checking bullshit