Fix broken convolution

A few other tidy ups as well