Merging in changes from version 4