Fixing some stupid bugs