Fixed null pointers for getName