more changes in LPU and bug fixes in photoreceptor code