Fixed compile-time errors and warnings.