Fixed warnings and tests