Microoptimisations to improve performance of unpacking