Cosmetic docs and fixed potential null value