Fix range expression and update issues