Fix several minor electricity issues.  Fixes #1059.