various fixes & improvements