Merge a few patches from raj for 0.3