Remove redundant lines and resolve Eclipse warnings