Applied fix from jaketrent