Several more simplifications and fixes