Code cleanup from the find bugs