Fixes for Buffer API