Fixed an error which causes undefined to be packed as null