Add test to ensure avg throws an error