Note that nelstrom's changes were merged here too