Fixed undefined index notices
Fixed misspelling in the comment

Signed-off-by: Igor Prokopenkov <cmyk777@gmail.com>