Several bugs fixed

The code still doesn't generate a system in equilibrium, but the
velocity sampling is on the right track, now.