Fixed some indexing bugs in templates hashes calculation and hashtable building.
Merge remote-tracking branch 'remotes/trunk/master'
Fixed offset and bound in RawReading.
Implemented 10, 30 or 50 templates generating.