Some improvements on nested statements