Cosmetic improvements to finalise.

Also minor refactoring to deposit_handler.