Fix potential null pointer and spacing.