lots of small fixes and improvements; pascal results