Fixed bug in custom energy expression modifications from last commits.