Fix infinite loop + support subversion 1.6