Fix unit tests and sample controller