adding more isset checking

Also:
- //end coments on large code blocks
- addition of braces around some single line blocks
Merge pull request #38 from zbtirrell/bcms-goodness

adding more isset checking