Code clean up.

Code clean up. Modified return codes.