Fixing issues in hooks class.