Fix for #436

also fixed typos in comments