Fixed various issues (it actually works now)