Cleaning up code. Added delete [].
Added range.
Disable effects tab when there is no effect.