Fix issues with density and binrect/histogram2d. (Fixes #101)