Fixed null pointer problem with generateMethodID.