A lot of small fixes and improvements here and there.