Fixing return value for integral and adding alpha computation for kernels.