bug fixes for pyton 2.6