a few random changes by CMS
correct a few self created bugs