fixed a couple of bugs in transfer and added a get_hmf convenience function