Fixed all warnings and errors