Bug fixes in tpsm and a new gitignore