Added a types argument to __init__ to specify a whitelisted set of types to use. Also convert tabs to spaces.