fix plugin registration logic, misc whitespace cleanings