Fixing some errors and making stuff work