Manually merged changes suggested by #162