Cleanup unused but set variables and uninitialized variables

Some error variables were removed as they weren't used but
keeping a listing of error variables that need to be checked
would probably be a good idea