Fix ArrayIndexOutOfBoundsException when deleting a theme.

Change-Id: Ia0415c3e013d07d2c8bf6dbb315a138ebc61c258