merged with cselig 7.x branch