Fix bugs in FSM repetition function.
Added Qt4 implementation of String class.