small docstring and comment tweaks
(#552)
avoid recalculating the same quantity multiple times
(#552)
fix bug that I introduced in previous commit
(#552)
formatting tweaks etc. in detectors tests
(#552)