Code cleanup

Removed unused code and fixed some Eclipse warnings.