Fix some build issues.

This pull request was worked on rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000).