Fixed some kernels accessing structuring element wrong order