Fixed the algorithm responsible for detecting used registers.