Fix buffer type detection