query alias support and some other smallish changes