Resolved lots of compiler warnings