Fixed problems and warnings.