Add missing case in encodeType
Remove unused import
Cleanup