Cleaned up code to remove Eclipse warnings