snippet support, various fixes