Cleanup: remove unused imports and unneeded casts.