#7 fixed wrong halo scaling in rare cases