Fixed #528 fixed #527 fixed #522 and other adjustement fot TOTB