Implemented extendPlugin. Fixed bugs. Added TODO notes.