Fixed warnings and debug compilation errors.