Explicitly branch call to energy_and_forces for each optional argument. Some compilers seem to have problems with NULL() pointers passed to optional arguments. Symptom is a segfault. Not sure myself for which combination of compilers/OS/etc this happens.