Fix bug where color mapping failed