Fixed rather embarrassing bug