Fixed segfaults in EAPI