fixing some detected mistakes