Adding indexed color support;Improving test.