Fixes and additions to Yashars patch