minor code cleaning, stricter tests