Update rules and tweak code so that it compiles using 10.6 SDK and i386 arch.