Removed overrides and changed casting (make java 1.5 compliant)