Fix bug, and Type literal anf refactor.