Tiny fix.
Fix function.
Fix syntax error.
Merge code into one script.