minor fixes to convolution and add unit tests