removed -fpermissive from compiler flags and solved warnings