fix storing of undefined values [closes #1]