Adding changes from JoeDao branch to master