Minor bug fixes

Checking len of component needs to look for len > 1 not 0 since len will
always be at minimum 1 due to split(',') on config.get. Also, fixed
misspelling of encode.