Fixed some warnings, commented some code