Minor changes from Johan's pull. Introduce some minor errors.