various fixes, improvements