Check for no supplied background color. Closes GH-165.
(cherry picked from commit ce14361)
Check for potential index out of bounds exception. GH-166
(cherry picked from commit 4248ed7)