Fixed an issue ccurrie pointed out