Fixed encoding bug in Hash and cleaned up other files