added types support, minor fixes