Fixed null errors