Some tweaks to facilitate the port to 1.8