Some tweaks to manage resources better.