Improve typespecs when formatted as strings