#58 Stop pipeline leaking

Also make synchronous running work again and do a bit of general pipeline tidy-up.