Fix for karma testing errors