Changes suggested by mattsjo