Option parsing here is a bit too fragile.