Added tests and file output.

Don't see any segfault making two LPs, so I guess #1 did the trick.