Rewrite getBufferParameter, which was completely wrong.