typeCount bug fixed