Final(hopefully) code fixes