Added compatibility to Python <2.5