Should have fixed the null pointer exceptions.