better support for conditionals, various fixes