Initial commit fixing invalid plugin script crashes