Some comments and minor code improvements [978]