Fixing some broken code