Numerous fixes from 0.2 -> master