Fixed bmp read issues.