fixed some more bugs
make purepack more robust with proper handline of "undefined"