Fixed logic for training / queries. Fixed list index bug.
fix lsa.samples.pl
apply hotfix to lsa