Add improvements suggested by Heinrich