Fixed some warnings, and virtual method definition