Styling might be improved, but I think this fixes #647.