Some logical improvements