Bug fixes and hooks for better customisation