Code cleanup; fixing unreturned result