Fixed some broken code