Fix errors and warnings, everything works