Merged diff from FrozenCow branch up to Jul 4, 2013.