fix everything Eelco proposed at github