Fixed reload code to be Python 3 compatible.