Added Karma and fixed some errors