improved sector type handling, added test