Duplicate changes provided by jamesmcfadden for develop branch #771 #765