util.cc: add check for environment clearing
Eliminate unnecessary return statements