[Fix] makeMasterFile: overflow in Id, cast to uint64 first and to uint16 later.

Signed-off-by: oleg komarov <o.komarov11@imperial.ac.uk>