Fix failing unit tests and missing copyright headers