Fixed logic error in getE method