fix a number of minors issues