Minor code inprovements