Be a bit more defensive about prefix parsing