Revert "Revert "Fixing some compiler warnings""

This reverts commit a6dcf6a337f01d7b49eb2569de620685de6603d9.