Null check for push/unshift, fixes #166