Python 3.2 compatability fixes

Signed-off-by: Zaar Hai <haizaar@haizaar.com>