Fixed and moved all warnings