Fixed some broken stuff. Code is getting hackier and hackier :(