Some small patches for 0.3.1