Fix issues
Clean up code