Shared variables bug fix.