Fixing some restriction stuff and removing commented testing code