Add LICENSE.txt
Fix wrong use of string functions