Fixes and helper functions