fixed some bugs in plugin

Signed-off-by: Ben Jackman <ben@jackman.biz>