Merged dustsnow and webs961's changes