Code reformat, minor fixes