FIX: Fixes for py2.6

@agramfort this should be the changes from the other PR. It would be good to have another person double-check that they work, at least on 2.7 if not also 2.6.