Fixed some indexing bugs in TLC library