Fixing some warnings throughout the project. Most of them have to do
with unused namespaces. A couple were for not closing streams.