(Still) debugging improved inpainting, cleaning up some code