Corrected some bugs derived from former cleanup.