minimize diff to upstream
removed some inappropriate return