Removed warnings and some obsolete code
Revert "Removed warnings and some obsolete code"

This reverts commit a951aa68297acbd29fbe96d5c74b18714f4fbe17.