Fix all the type issues

Hello @x-ma, 

Please review the following commits I made in branch 'nick-compiler'.

2329812f097f8640679849195efddd7c901c5862 (2014-04-01 20:03:44 -0700)
Fix all the type issues

R=@x-ma