Fixed mistake.
Might be a few weird things because I used a decompiler.