Corrected some warnings, and a bug