Cleaned up code warnings and removed unused code. Fixed name of _staticDefaultEncoding into staticDefaultEncoding to fullfil checkstyle.