Added som changes to make it compatible with 0.6