Fix error with float vs int in writeTPL