Tried to fix errors and warnings