Fixed some warnings and errors.