fixed type ambiguity bug, issue #2