fixed a few bugs in bit planar kernel