Fixed another variable scope issue. Added some ifdef statements.