fixes #907, segfault when ampersands where missing