added casttochar test, some cosmetics