Some bugfixes and stuuuuff