Fixing some issues to ensure it works