Fixed some EGL related errors.

Change-Id: I240bf93d03b382250efbb330037d4e4b32575e89