Add type check to the __init__ method. For #19.