Fix karma unit tests