Code clean-up and additional unit tests added for Phase and Event methods.