Many testing fixes