Update code to avoid error/notice on CLI