fixed errors and warnings