Fix BMP indexing