Error mysteriously disappears if printing?