Fix some testability issues