Fix program compilation errors not being exported
Add some program-related tests

cc #15