Merged v 0.5 into our custom version.