Adding in unit test for typeOf and fixed main script