Plugin code cleanup, stricter compliation