Corrected bugs.
Added helper methods.
Corrected bugs.