Some bits and pieces from reviewing the code...