changes to compile with rustc v0.12

changes to create compatibility with rustc v0.12. @charliesome, could you please review this when you have time?