fixed null pointer and index out of bounds exceptions - added issue reference
fixed null pointer and index out of bounds exceptions - added issue reference

ebussieres/pebble,PebbleTemplates/pebble,PebbleTemplates/pebble,mbosecke/pebble,DanStout/pebble