cleaned up ewald.c and fixed core dump with ebin.c