Added bounds checking for colors and notes.