First draft of 1.7.10 port

Cleaned up all the warnings and errors.